{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>上传检修报告</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">报告名称：</label>
                            <div class="layui-input-block">
                                <input type="text" name="oi_wx_report_name" lay-verify="required" placeholder="报告名称"  value="{$data.oi_wx_report_name}" class="layui-input ">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">检修报告：</label>
                            <input type="hidden" name="oi_wx_report_url" id="lay-img" value="{$data.oi_wx_report_url}">
                            <div class="layui-input-block">
                                <div id="lay-upload">上传报告</div>
                                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                    文件：
<!--                                    <div class="layui-upload-list" id="lay-list">-->
<!--                                        {$data.oi_wx_report_url ?: '-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;'}-->
<!--                                    </div>-->
                                    <div class="layui-upload-list" id="lay-list">
                                        {$data.oi_wx_report_url ?: '暂未上传'}
                                    </div>
                                </blockquote>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">报告备注(用户不可见)：</label>
                            <div class="layui-input-block">
                                <textarea name="oi_wx_report_remark" placeholder="报告备注" class="layui-input" style="height: 100px;">{$data.oi_wx_report_remark ?: ''}</textarea>
                            </div>
                        </div>
                        <input type="hidden" value="{$data.oi_id}" name="oi_id">
                        <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    wk.uploadImg({size:5,type:'PDF,pdf',url:"{:url('Upload/upload')}",domain:"",video:2});
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('orderSonPdf')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        $("button").removeClass('layui-disabled').removeAttr('disabled');
                        wk.error(res.msg);
                        return false;
                    }
                }
            })
        });
    });
</script>

</body>
</html>
